#Must Set Direct to Location of Replication File
#setwd("")
data<-read.csv("ReplicationData.csv",stringsAsFactors=F)
#Total Number of Foreign Born Ambassadors
nrow(data)
#Total Number Who Served in Birht Country
sum(data[,"Posted.to.Birth.Country"]=="Yes")
#As a Proportion
sum(data[,"Posted.to.Birth.Country"]=="Yes")/nrow(data)
#Total Number of CoM Postings
sum(data[,"Total.CoM.Postings"])
#Birth Country postings as a proportion therefo
sum(data[,"Posted.to.Birth.Country"]=="Yes")/sum(data[,"Total.CoM.Postings"])
#95% CI thereof
proportion<-sum(data[,"Posted.to.Birth.Country"]=="Yes")/sum(data[,"Total.CoM.Postings"])
n<-sum(data[,"Total.CoM.Postings"])
se<-sqrt(proportion*(1-proportion)/n)
#Lower Bound
proportion-1.96*se
#Upper Bound
proportion+1.96*se